#!/usr/bin/env python
#coding:utf-8

import wx

class StaticTextFrame(wx.Frame):
    def __init__(self):
        wx.Frame.__init__(self, None, -1, 'Static Text Example',
                          size=(400, 300))
        panel = wx.Panel(self, -1)

        #这是一个静态文本
        wx.StaticText(panel, -1, "This is an example of static text.", (100, 10))

        #来段中文的
        chs = wx.StaticText(panel, -1, '这是一段中文的静态文字', (100, 30))
        chs.SetForegroundColour('green')
        chs.SetBackgroundColour('black')

        #捆在中间的文字
        center = wx.StaticText(panel, -1, 'align center', (100, 50),
                               (160, -1), wx.ALIGN_CENTER)
        center.SetForegroundColour('red')
        center.SetBackgroundColour('yellow')
        font = wx.Font(18, wx.DECORATIVE, wx.ITALIC, wx.NORMAL)
        center.SetFont(font)

        wx.StaticText(panel, -1, "Your text\ncan be split\n"
                "over multiple lines\n\neven blank ones", (20,150))

#显示对齐的多行文本
        wx.StaticText(panel, -1, "Multi-line text\ncan also\n"
                "be right aligned\n\neven with a blank", (220,150),
                style=wx.ALIGN_RIGHT)

if __name__ == '__main__':
    app = wx.PySimpleApp()
    frame = StaticTextFrame()
    frame.Show()
    app.MainLoop()
